home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pangomm-1.4 / pangomm / attriter.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  4.2 KB  |  148 lines

  1. // -*- c++ -*-
  2. // Generated by gtkmmproc -- DO NOT MODIFY!
  3. #ifndef _PANGOMM_ATTRITER_H
  4. #define _PANGOMM_ATTRITER_H
  5.  
  6. #include <glibmm.h>
  7.  
  8. /* attriter.h
  9.  *
  10.  * Copyright (C) 1998-1999 The gtkmm Development Team
  11.  *
  12.  * This library is free software; you can redistribute it and/or
  13.  * modify it under the terms of the GNU Library General Public
  14.  * License as published by the Free Software Foundation; either
  15.  * version 2 of the License, or (at your option) any later version.
  16.  *
  17.  * This library is distributed in the hope that it will be useful,
  18.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  20.  * Library General Public License for more details.
  21.  *
  22.  * You should have received a copy of the GNU Library General Public
  23.  * License along with this library; if not, write to the Free
  24.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  25.  */
  26.  
  27. #include <glibmm/slisthandle.h>
  28. #include <pangomm/attributes.h>
  29.  
  30.  
  31. namespace Pango
  32. {
  33.  
  34. /** A Pango::AttrIter is used to represent an iterator through a Pango::AttrList.
  35.  * A new iterator is created with Pango::AttrList::get_iter(). Once the iterator is created,
  36.  * it can be advanced through the style changes in the text using Pango::AttrIter::next().
  37.  * At each style change, the range of the current style segment and the attributes currently in effect can be queried.
  38.  */
  39. class AttrIter
  40. {
  41.   public:
  42. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  43.   typedef AttrIter CppObjectType;
  44.   typedef PangoAttrIterator BaseObjectType;
  45. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  46.  
  47. private:
  48.  
  49.   
  50. public:
  51.   typedef std::forward_iterator_tag iterator_category;
  52.   typedef int                       difference_type;
  53.  
  54. protected:
  55.   AttrIter();
  56.  
  57. public:
  58.   explicit AttrIter(PangoAttrIterator* castitem, bool take_copy=true);
  59.   AttrIter(const AttrIter& src);
  60.  
  61.   ~AttrIter();
  62.  
  63.   AttrIter& operator=(const AttrIter& src);
  64.  
  65.   /** Advance the iterator until the next change of style.
  66.    * The iterator becomes invalid if the end of the list is reached.
  67.    * @return The iterator itself.
  68.    */
  69.   AttrIter&      operator++();
  70.  
  71.   const AttrIter operator++(int);
  72.  
  73.   /** Check whether the iterator is valid.
  74.    * @return <tt>true</tt> if the iterator is valid.
  75.    */
  76.   operator bool() const;
  77.  
  78.   /** The same as operator++().
  79.    * @return <tt>false</tt> if the end of the list is reached.
  80.    */
  81.   bool next();
  82.  
  83.   
  84.   /** Get the range of the current segment.
  85.    * @param start Location to store the start of the range.
  86.    * @param end Location to store the end of the range.
  87.    */
  88.   void get_range(int& start, int& end) const;
  89.   
  90.   /** Find the current attribute of a particular type at the iterator
  91.    * location. When multiple attributes of the same type overlap,
  92.    * the attribute whose range starts closest to the current location
  93.    * is used.
  94.    * @param type The type of attribute to find.
  95.    * @return The current attribute of the given type, or <tt>0</tt>
  96.    * if no attribute of that type applies to the current
  97.    * location.
  98.    */
  99.   Attribute get_attribute(AttrType type) const;
  100.  
  101.   /** Get the font description used at the current iterator position.
  102.    * @return The font description used at the current iterator position.
  103.    */
  104.   FontDescription get_font_desc() const;
  105.  
  106.   /** Gets the language tag used at current iterator position.
  107.    * @return The language tag or an empty Pango::Language object if non is found.
  108.    */
  109.   Language get_language() const;
  110.  
  111.   /** Gets a list of non-font attributes at the the current iterator position.
  112.    * Only the highest priority value of each attribute will be added to this list.
  113.    * @return The list of non-font attributes at the current iterator position.
  114.    */
  115.   SListHandle_Attribute get_extra_attrs() const;
  116.  
  117.   /** Gets a list all attributes a the current position of the
  118.    * iterator.
  119.    *
  120.    * @result A list of all attributes for the current range.
  121.    */
  122.   SListHandle_Attribute get_attrs() const;
  123.   
  124.  
  125.   PangoAttrIterator*       gobj()       { return gobject_; }
  126.   const PangoAttrIterator* gobj() const { return gobject_; }
  127.  
  128. protected:
  129.   PangoAttrIterator* gobject_;
  130.  
  131.  
  132. };
  133.  
  134. } // namespace Pango
  135.  
  136.  
  137. namespace Glib
  138. {
  139.  
  140. /** @relates Pango::AttrIter */
  141. Pango::AttrIter wrap(PangoAttrIterator* object, bool take_copy=false);
  142.  
  143. } // namespace Glib
  144.  
  145.  
  146. #endif /* _PANGOMM_ATTRITER_H */
  147.  
  148.